package org.yefei.homeworkday02;

import java.util.Scanner;

public class FiveNumber {
	public static void main(String[] args) {
		//4：输入一个5位整数，求他们每一位上数字的和，并输出
		Scanner input = new Scanner(System.in);
		System.out.println("请输入一个5位整数：");
		int number = input.nextInt();
		int wan = number / 10000;
		int qian=number/1000%10;
		int bai = number / 100 % 10;
		int shi = number / 10 % 10;
		int ge = number % 10;
		int sum = wan + qian + bai + shi + ge;
		System.out.println("万位是" + wan + ",千位是" + qian + ",百位是" + bai + ",十位是" + shi + ",个位是" + ge);
		System.out.println("五位数之和是" + sum);
	}
}
